#include<iostream>
#include <memory>
#include "udp_server.hpp"

using namespace std;
using namespace ns_server;

void Usage(char* argv[])
{
  cout << "Usage:" << endl;
  cout << "\t" << argv[0] << " Port" << endl;
}

int main(int argc, char* argv[])
{
  if(argc != 2)
  {
    Usage(argv);
    return USAGE_ERR;
  }

  unique_ptr<UdpServer> usvr(new UdpServer(atoi(argv[1])));

  //首先初始化服务器
  usvr->InitServer();
  
  //然后启动服务器
  usvr->StartServer();

  return 0;
}
